<!--
 * @Author: your name
 * @Date: 2021-07-06 22:02:42
 * @LastEditTime: 2021-07-18 10:11:08
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \mu-gridsome\src\pages\post.vue
-->
<template>
    <Layout>
        <div>
            <h1>Posts 1</h1>
            <ul>
                <li v-for="post in $page.posts.edges" :key="post.node.id">
                    <g-link to='/'>
                        {{ post.node.title }}
                    </g-link>
                </li>
            </ul>
        </div>
    </Layout>
</template>
<page-query>
    query {
    posts: allPost {
    edges {
    node{
    id
    title
    }
    }
    }
    }

</page-query>
<script>
    import axios from 'axios'
    export default {
        name: 'Posts',
        data() {
            return {
                // posts: []
            }
        },
        //  async created() {
        //    let {data} = await axios.get('https://jsonplaceholder.typicode.com/posts')
        //    this.posts = data
        //  }
    }
</script>